home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-01 | 2.0 KB | 42 lines | [TEXT/KAHL] |
- /************************************************************************************************
-
- The following is part of a conversion Marc White* and myself had after I gave him
- version 1.0 of CDEF Debugger. Marc does a great job explaning the new method of
- the CDEF stub we are using now in version 2.x
-
- Marc: That's a cool application. And thanks for the kind mention.
-
- I use a CDEF and LDEF stub method in my program here. I use my CDEF for a
- pretty complicated C++ toolbar kinda thing, but the stub part is pretty
- straightforward. The stub lets you debug it a source level, plus I use
- Universal Procedure Pointers so that the CDEF will work in 68K and Native
- modes. I'll append the code at the end of this message, you can use it in
- updates to "CDEF - Debugger" if you want...
-
- Doug: Um.. Marc... I not know what stub is...
-
- Marc: Sorry to confuse you there.
-
- Ok, here's a very simply explanation of a CDEF stub. You start by writing a
- normal CDEF, but instead of handling all of the CDEF stuff in the code
- resource, you just take the parameters that the Toolbox sends you and pass
- them to the real CDEF which is in the application code. How do you find the
- real CDEF? Because when you create the control in your code, you are tricky
- and you store the address of the CDEF routine you want to use in the
- control's refCon.
-
- This method is actually alot simpler than writing an assembly jump table
- thingum. Plus, it is upwardly compatible with PowerPC code. The assembly
- hack will break like the wind if it is executed while in native mode.
-
- The Universal Headers is just a folder of header files from Apple. They are
- trying to standardize the headers for toolbox routines. You can determine
- if you have them by looking in your Symantec folder for a folder called
- "Universal Headers".
-
-
- * Didn't I tell you Marc was a bright guy!
-
- ************************************************************************************************/
-
-